﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CreateLoan.aspx.cs" Inherits="Pap.Web.Modules.Loan.Views.CreateLoan"
    MasterPageFile="~/MasterPages/Core.Master" Title="<% $Resources:PageTitle %>" %>

<asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <style type="text/css">
        .asp-radiobtnlist
        {
            font-family: tahoma,arial,helvetica,sans-serif;
            font-size: 12px !important;
            padding-right: 105px;
        }
    </style>
    <script type="text/javascript">
        function MilitaryStatusChanged() {
            var cmb = Ext.getCmp('cmbMilitaryStatus');
            var datecontrol = Ext.getCmp('dateMilitary');
            if (cmb.value == '826c3b2f-7493-4551-0000-c4a5d6ec9cac') {
                datecontrol.show();
                datecontrol.allowBlank = false;
            }
            else {
                datecontrol.clearInvalid();
                datecontrol.hide();
                datecontrol.allowBlank = true;
            }
        }


        var FilterCreationCenters = function (value, combo, store) {
            if (combo.view) {
                combo.view.store.removeAll();
            }
            else combo.store.removeAll();
            if (value != '') {
                for (var i = 0; i < store.data.items.length; i++) {
                    var record = store.data.items[i].data;
                    if (record['GovernorateID'] == value)
                        combo.addItem(record['CenterName'], record['CenterID']);
                }
            }
            combo.originalValue = '';
            combo.reset();
        }

        var FilterCreationLocations = function (value, combo, store) {
            if (combo.view) {
                combo.view.store.removeAll();
            }
            else combo.store.removeAll();
            if (value != '') {
                for (var i = 0; i < store.data.items.length; i++) {
                    var record = store.data.items[i].data;
                    if (record['CenterID'] == value)
                        combo.addItem(record['IssuePlaceName'], record['IssuePlaceID']);
                }
            }
            combo.originalValue = '';
            combo.reset();
        }

        var FilterSSNLocations = function (value, combo, store) {
            if (combo.view) {
                combo.view.store.removeAll();
            }
            else combo.store.removeAll();
            if (value != '') {
                for (var i = 0; i < store.data.items.length; i++) {
                    var record = store.data.items[i].data;
                    if (record['GovernorateID'] == value)
                        combo.addItem(record['CenterName'], record['CenterID']);
                }
            }
            combo.originalValue = '';
            combo.reset();
        }

        var filterGuid = function (value, dataIndex, record) {
            var val = record.get(dataIndex);
            if (!Ext.isEmpty(value, false) && val != value) {
                return false;
            }
            return true;
        }

        var getRecordFilter = function (value, dataIndex) {
            return function (record) {
                if (!filterGuid(value, dataIndex, record))
                    return false;
                return true;
            };
        }

        Ext.apply(Ext.form.VTypes,
    {
        'SSIDVType': function (val, field) {
            var regexExp = /^[0-9]+$/;
            if (!regexExp.test(val)) return false;
            var year = parseInt(val.substring(1, 3), 10);
            var month = parseInt(val.substring(3, 5), 10);
            var day = parseInt(val.substring(5, 7), 10);

            var yearBool = (year > 0);
            var monthBool = (month <= 12 && month > 0);
            var dayBool = (day <= 31 && day > 0);
            return (yearBool && dayBool && monthBool);
        }

    }
    );
        Ext.apply(Ext.form.VTypes,
    {
        'BirthDate': function (val, field) {
            var valModified = val.toString().replace("-", "");
            valModified = valModified.replace("-", "");
            var year = parseInt((valModified.substring(4, 8)));
            var month = parseInt((valModified.substring(2, 4)));
            var day = parseInt((valModified.substring(0, 2)));

            var currentTime = new Date();
            var age = currentTime.getFullYear() - year;

            if (month > currentTime.getMonth()) {
                age--;
            }
            else {
                if (month == currentTime.getMonth()) {
                    if (currentTime.getDay() < day)
                        age--;
                }
            }

            var ageLimit = Ext.getCmp('ageLimit')
            return (age <= ageLimit.getValue());
        }
    }
    );
    </script>
    <ext:Hidden runat="server" IDMode="Static" ID="ageLimit" Text="300" />
    <ext:Store runat="server" ID="storeGovernorates" AutoLoad="True" IDMode="Legacy"
        SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="GovernorateID">
                <Fields>
                    <ext:RecordField Name="GovernorateID" />
                    <ext:RecordField Name="GovernorateName" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="storeBirthLocations" AutoLoad="True" IDMode="Legacy"
        SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="CenterID">
                <Fields>
                    <ext:RecordField Name="CenterID" />
                    <ext:RecordField Name="CenterName" />
                    <ext:RecordField Name="GovernorateID" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store ID="storeMilitaryStatus" runat="server">
        <Reader>
            <ext:JsonReader ReaderID="MilitaryStatusID">
                <Fields>
                    <ext:RecordField Name="MilitaryStatusID" />
                    <ext:RecordField Name="MilitaryStatusName" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="storeCreationGovernorates" AutoLoad="True" IDMode="Legacy"
        SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="GovernorateID">
                <Fields>
                    <ext:RecordField Name="GovernorateID" />
                    <ext:RecordField Name="GovernorateName" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="storeCreationCenters" AutoLoad="True" IDMode="Legacy"
        SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="CenterID">
                <Fields>
                    <ext:RecordField Name="CenterID" />
                    <ext:RecordField Name="CenterName" />
                    <ext:RecordField Name="GovernorateID" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="storeCreationLocations">
        <Reader>
            <ext:JsonReader ReaderID="IssuePlaceID">
                <Fields>
                    <ext:RecordField Name="IssuePlaceID" />
                    <ext:RecordField Name="IssuePlaceName" />
                    <ext:RecordField Name="CenterID" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="storeEducationalLevels" AutoLoad="True" IDMode="Legacy"
        meta:resourcekey="storeEducationalLevelsResource1" SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="EducationalLevelID">
                <Fields>
                    <ext:RecordField Name="EducationalLevelID">
                        <Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
                    </ext:RecordField>
                    <ext:RecordField Name="EducationalLevelName">
                        <Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
                    </ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="storeSocialStatuses" AutoLoad="True" IDMode="Legacy"
        meta:resourcekey="storeSocialStatusesResource1" SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="SocialStatusID">
                <Fields>
                    <ext:RecordField Name="SocialStatusID">
                        <Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
                    </ext:RecordField>
                    <ext:RecordField Name="SocialStatusName">
                        <Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
                    </ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="storeLegalForms" AutoLoad="True" IDMode="Legacy" meta:resourcekey="storeLegalFormsResource1"
        SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="LegalFormID">
                <Fields>
                    <ext:RecordField Name="LegalFormID">
                        <Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
                    </ext:RecordField>
                    <ext:RecordField Name="LegalFormName">
                        <Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
                    </ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="storeProjects" AutoLoad="True" IDMode="Legacy" meta:resourcekey="storeProjectsResource1"
        SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="ProjectID">
                <Fields>
                    <ext:RecordField Name="ProjectID">
                        <Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
                    </ext:RecordField>
                    <ext:RecordField Name="ProjectName">
                        <Convert Handler="" Args="value,record" FormatHandler="False"></Convert>
                    </ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="storeProjectStages" AutoLoad="True" IDMode="Legacy"
        meta:resourcekey="storeProjectStagesResource1" SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="ProjectStageID">
                <Fields>
                    <ext:RecordField Name="ProjectStageID" />
                    <ext:RecordField Name="Stage" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="storeLoanPlaces" AutoLoad="True" IDMode="Legacy" meta:resourcekey="storeLoanPlacesResource1"
        SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="LoanPlaceID">
                <Fields>
                    <ext:RecordField Name="LoanPlaceID" />
                    <ext:RecordField Name="LoanPlaceName" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="storeLoanPaymentMethods" AutoLoad="True" IDMode="Legacy"
        meta:resourcekey="storeLoanPaymentMethodsResource1" SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="LoanPaymentMethodID">
                <Fields>
                    <ext:RecordField Name="LoanPaymentMethodID" />
                    <ext:RecordField Name="LoanPaymentMethodName" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:FitLayout ID="fit" runat="server" IDMode="Legacy" meta:resourcekey="fitResource1">
        <ext:FormPanel ID="panelWhole" runat="server" IDMode="Static" AutoScroll="true" meta:resourcekey="PanelResource2">
            <Body>
                <ext:FormLayout runat="server">
                    <ext:Anchor>
                        <ext:Panel Icon="UserRed" ID="panelCustomer" runat="server" Collapsible="true" meta:resourcekey="panelCustomerResource1"
                            Border="false">
                            <Body>
                                <ext:FormLayout ID="FormLayout1" runat="server" ElementStyle="" ItemCls="" meta:resourcekey="FormLayout1Resource1">
                                    <ext:Anchor Horizontal="85%">
                                        <ext:Panel ID="PanelPersonalInfo" runat="server" FormGroup="true" Border="true" Title="<%$Resources:PanelPersonalInfoTitle %>">
                                            <Body>
                                                <ext:FormLayout HideLabel="true" runat="server">
                                                    <ext:Anchor>
                                                        <ext:MultiField runat="server" HideLabel="true">
                                                            <Fields>
                                                                <ext:Label runat="server" ID="lblCustomerName" Text="<% $Resources:lblCustomerNameText %>" />
                                                                <ext:TextField runat="server" ID="txtCustomer" MaxLength="50" AllowBlank="False"
                                                                    EmptyText="Customer Name" Regex="^[A-zء-ي' ']+$" meta:resourcekey="txtCustomerResource1"
                                                                    Text="" />
                                                                <ext:Label runat="server" ID="lblGender" Text="<% $Resources:lblGenderText %>" />
                                                                <ext:Radio ID="radioMale" runat="server" BoxLabel=" Male " GroupName="gender" Checked="True"
                                                                    Width="100px" meta:resourcekey="radioMaleResource1">
                                                                </ext:Radio>
                                                                <ext:Radio ID="radioFemale" runat="server" BoxLabel=" Female " GroupName="gender"
                                                                    Width="100px" meta:resourcekey="radioFemaleResource1">
                                                                </ext:Radio>
                                                            </Fields>
                                                        </ext:MultiField>
                                                    </ext:Anchor>
                                                </ext:FormLayout>
                                            </Body>
                                        </ext:Panel>
                                    </ext:Anchor>
                                    <ext:Anchor Horizontal="85%">
                                        <ext:Panel ID="panelSSIDInfo" FormGroup="true" runat="server" Title="<%$ Resources:panelSSIDInfoTitle %>">
                                            <Body>
                                                <ext:FormLayout ID="FormLayout3" runat="server" HideLabel="true">
                                                    <ext:Anchor>
                                                        <ext:Panel runat="server" ID="panelSSIDErrors" Border="false">
                                                            <Body>
                                                                <ext:FormLayout runat="server">
                                                                    <ext:Anchor>
                                                                        <ext:Panel runat="server" ID="panelGuarantorError" Hidden="true">
                                                                            <Body>
                                                                                <ext:Label ID="lblError" runat="server" Icon="Error" Text="<%$ Resources:GuarntorWarningText%>" />
                                                                            </Body>
                                                                        </ext:Panel>
                                                                    </ext:Anchor>
                                                                    <ext:Anchor>
                                                                        <ext:Panel runat="server" ID="panel1" Hidden="true">
                                                                            <Body>
                                                                                <ext:Label ID="Label1" runat="server" Icon="Error" Text="<%$ Resources:GuarntorWarningText%>" />
                                                                            </Body>
                                                                        </ext:Panel>
                                                                    </ext:Anchor>
                                                                </ext:FormLayout>
                                                            </Body>
                                                        </ext:Panel>
                                                    </ext:Anchor>
                                                    <ext:Anchor>
                                                        <ext:MultiField ID="MultiField1" runat="server" HideLabel="True" meta:resourcekey="MultiFieldResource1">
                                                            <Fields>
                                                                <ext:Label runat="server" ID="lblCustomerSSID" Text="<%$ Resources:lblCustomerSSIDText %>" />
                                                                <ext:TextField runat="server" ID="txtSSID" MinLength="14" MaxLength="14" AllowBlank="False"
                                                                    EmptyText="Customer SSID" Regex="^[0-9]+$" CausesValidation="true" Vtype="SSIDVType"
                                                                    VtypeText="SSID format is not valid" meta:resourcekey="txtSSIDResource1">
                                                                    <AjaxEvents>
                                                                        <Change OnEvent="txtSSID_Changed" />
                                                                    </AjaxEvents>
                                                                </ext:TextField>
                                                                <ext:Label runat="server" ID="lblSSIDCreationDate" Text="<%$ Resources:lblSSIDCreationDateText %>" />
                                                                <ext:ComboBox ID="cmbSSIDMonth" runat="server" EmptyText="Month" Editable="False"
                                                                    AllowBlank="False" meta:resourcekey="cmbMonthsResource1" TriggerAction="All" Width="100px">
                                                                    <Items>
                                                                        <ext:ListItem Text="<%$ Resources:January %>" Value="1" />
                                                                        <ext:ListItem Text="<%$ Resources:February %>" Value="2" />
                                                                        <ext:ListItem Text="<%$ Resources:March %>" Value="3" />
                                                                        <ext:ListItem Text="<%$ Resources:April %>" Value="4" />
                                                                        <ext:ListItem Text="<%$ Resources:May %>" Value="5" />
                                                                        <ext:ListItem Text="<%$ Resources:June %>" Value="6" />
                                                                        <ext:ListItem Text="<%$ Resources:July %>" Value="7" />
                                                                        <ext:ListItem Text="<%$ Resources:August %>" Value="8" />
                                                                        <ext:ListItem Text="<%$ Resources:September %>" Value="9" />
                                                                        <ext:ListItem Text="<%$ Resources:October %>" Value="10" />
                                                                        <ext:ListItem Text="<%$ Resources:November %>" Value="11" />
                                                                        <ext:ListItem Text="<%$ Resources:December %>" Value="12" />
                                                                    </Items>
                                                                </ext:ComboBox>
                                                                <ext:TextField runat="server" ID="txtSSIDYear" MinLength="4" MaxLength="4" AllowBlank="False"
                                                                    EmptyText="SSID Creation Year" Regex="^[0-9]+$" CausesValidation="true" VtypeText="SSID Year format is not valid"
                                                                    meta:resourcekey="dateSSIDCreationYearResource1">
                                                                </ext:TextField>
                                                            </Fields>
                                                        </ext:MultiField>
                                                    </ext:Anchor>
                                                    <ext:Anchor>
                                                        <ext:Label HideLabel="true" runat="server" ID="lblSSIDCreationLocation" Text="<%$ Resources:lblSSIDCreationLocationText %>" />
                                                    </ext:Anchor>
                                                    <ext:Anchor>
                                                        <ext:MultiField ID="MultiField2" runat="server" HideLabel="True" meta:resourcekey="MultiFieldResource1">
                                                            <Fields>
                                                                <ext:ComboBox ID="cmbCreationGovernorates" runat="server" StoreID="storeCreationGovernorates"
                                                                    DisplayField="GovernorateName" ValueField="GovernorateID" EmptyText="Governotate"
                                                                    meta:resourcekey="cmbCreationGovernorates1" TriggerAction="All" Mode="Local"
                                                                    Editable="false" ForceSelection="true" TypeAhead="true">
                                                                    <Listeners>
                                                                        <Select Handler="FilterCreationCenters(this.getValue(), #{cmbCreationCenters}, #{storeCreationCenters});" />
                                                                    </Listeners>
                                                                </ext:ComboBox>
                                                                <ext:ComboBox ID="cmbCreationCenters" runat="server" EmptyText="Centers" meta:resourcekey="cmbCreationCenters1"
                                                                    Mode="Local" ForceSelection="true" Editable="false" TypeAhead="true" TriggerAction="All">
                                                                    <Listeners>
                                                                        <Select Handler="FilterCreationLocations(this.getValue(), #{cmbCreationLocation}, #{storeCreationLocations});" />
                                                                    </Listeners>
                                                                </ext:ComboBox>
                                                                <ext:ComboBox ID="cmbCreationLocation" runat="server" AllowBlank="False" EmptyText="Creation Location"
                                                                    meta:resourcekey="cmbCreationLocation1" Mode="Local" ForceSelection="true" Editable="false"
                                                                    TypeAhead="true" TriggerAction="All">
                                                                </ext:ComboBox>
                                                            </Fields>
                                                        </ext:MultiField>
                                                    </ext:Anchor>
                                                </ext:FormLayout>
                                            </Body>
                                        </ext:Panel>
                                    </ext:Anchor>
                                    <ext:Anchor Horizontal="85%">
                                        <ext:Panel ID="panelBirthData" runat="server" FormGroup="true" Title="<%$ Resources:panelBirthDataTitle %>">
                                            <Body>
                                                <ext:FormLayout ID="FormLayout4" runat="server" HideLabels="true">
                                                    <ext:Anchor>
                                                        <ext:MultiField ID="MultiField3" HideLabel="true" runat="server">
                                                            <Fields>
                                                                <ext:Label runat="server" ID="lblBirthDate" Text="<% $Resources:lblBirthDateText %>" />
                                                                <ext:TextField runat="server" ID="txtBirthDate" MaxLength="50" AllowBlank="False"
                                                                    NoteAlign="Top" EmptyText="BirthDate" ReadOnly="True" Vtype="BirthDate" meta:resourcekey="txtBirthDateResource1">
                                                                </ext:TextField>
                                                            </Fields>
                                                        </ext:MultiField>
                                                    </ext:Anchor>
                                                    <ext:Anchor>
                                                        <ext:Label runat="server" ID="lblBirthLocation" Text="<% $Resources:lblBirthLocationText %>" />
                                                    </ext:Anchor>
                                                    <ext:Anchor>
                                                        <ext:MultiField ID="MultiField4" runat="server" HideLabel="True" meta:resourcekey="MultiFieldResource2">
                                                            <Fields>
                                                                <ext:ComboBox ID="cmbGovernates" runat="server" StoreID="storeGovernorates" DisplayField="GovernorateName"
                                                                    ValueField="GovernorateID" Editable="false" EmptyText="Governotate" meta:resourcekey="cmbGovernates1"
                                                                    TriggerAction="All">
                                                                    <Listeners>
                                                                        <Select Handler="FilterSSNLocations(this.getValue(), #{cmbBirthLocations}, #{storeBirthLocations});" />
                                                                        <Change Handler="FilterSSNLocations(this.getValue(), #{cmbBirthLocations}, #{storeBirthLocations});" />
                                                                    </Listeners>
                                                                </ext:ComboBox>
                                                                <ext:ComboBox ID="cmbBirthLocations" runat="server" EmptyText="Centers" Editable="False"
                                                                    meta:resourcekey="cmbBirthLocations1" Mode="Local" ForceSelection="true" TypeAhead="true"
                                                                    TriggerAction="All" AllowBlank="false">
                                                                </ext:ComboBox>
                                                            </Fields>
                                                        </ext:MultiField>
                                                    </ext:Anchor>
                                                </ext:FormLayout>
                                            </Body>
                                        </ext:Panel>
                                    </ext:Anchor>
                                    <ext:Anchor Horizontal="85%">
                                        <ext:Panel ID="panelConactData" FormGroup="true" runat="server" Title="<% $Resources:panelConactDataTitle %>">
                                            <Body>
                                                <ext:FormLayout ID="FormLayout5" runat="server" HideLabels="true">
                                                    <ext:Anchor>
                                                        <ext:MultiField ID="MultiField5" runat="server" HideLabel="True" Width="600px" meta:resourcekey="MultiFieldResource4">
                                                            <Fields>
                                                                <ext:Label runat="server" ID="lblTele" Text="<% $Resources:lblTeleText %>" />
                                                                <ext:TextField runat="server" ID="txtTele" MaxLength="12" AllowBlank="False" NoteAlign="Top"
                                                                    EmptyText="Telephone" Width="200px" meta:resourcekey="txtTeleResource1" Regex="^[0-9]+$"
                                                                    RegexText="The entery isn't valid" />
                                                                <ext:Label runat="server" ID="lblMobile" Text="<% $Resources:lblMobileText %>" />
                                                                <ext:TextField runat="server" ID="txtMobile" MaxLength="12" AllowBlank="False" EmptyText="MobilePhone"
                                                                    NoteAlign="Top" Width="200px" meta:resourcekey="txtMobileResource1" Regex="^[0-9]+$"
                                                                    RegexText="The entery isn't valid" />
                                                            </Fields>
                                                        </ext:MultiField>
                                                    </ext:Anchor>
                                                    <ext:Anchor>
                                                        <ext:Label runat="server" ID="lblAddress" Text="<% $Resources:lblAddressText %>" />
                                                    </ext:Anchor>
                                                    <ext:Anchor>
                                                        <ext:TextArea runat="server" ID="txtAddress" AllowBlank="False" NoteAlign="Top" HideLabel="True"
                                                            EmptyText="Address" Width="600px" Regex="^[0-9A-zء-ي' '\n]+$" meta:resourcekey="txtAddressResource1"
                                                            MaxLength="8000" />
                                                    </ext:Anchor>
                                                </ext:FormLayout>
                                            </Body>
                                        </ext:Panel>
                                    </ext:Anchor>
                                    <ext:Anchor Horizontal="85%">
                                        <ext:Panel ID="panelOtherData" FormGroup="true" runat="server" Title="<%$Resources:panelOtherDataTitle %>">
                                            <Body>
                                                <ext:FormLayout ID="FormLayout6" runat="server" HideLabels="true">
                                                    <ext:Anchor>
                                                        <ext:MultiField runat="server">
                                                            <Fields>
                                                                <ext:Label runat="server" ID="lblMilitaryStatus" Text="<%$Resources:lblMilitaryStatus %>" />
                                                                <ext:ComboBox ID="cmbMilitaryStatus" IDMode="Static" StoreID="storeMilitaryStatus"
                                                                    runat="server" ValueField="MilitaryStatusID" DisplayField="MilitaryStatusName"
                                                                    Editable="false" AllowBlank="false" meta:resourcekey="cmbMilitaryStatusResource">
                                                                    <Listeners>
                                                                        <Select Handler="MilitaryStatusChanged()" />
                                                                    </Listeners>
                                                                </ext:ComboBox>
                                                                <ext:DateField runat="server" ID="dateMilitary" Format="dd-MM-yyyy" IDMode="Static"
                                                                    EmptyText="Date" Width="200px" AllowBlank="False" meta:resourcekey="dateMilitaryResource1">
                                                                </ext:DateField>
                                                            </Fields>
                                                        </ext:MultiField>
                                                    </ext:Anchor>
                                                    <ext:Anchor>
                                                        <ext:MultiField ID="MultiField6" runat="server" HideLabel="True" meta:resourcekey="MultiField12Resource1">
                                                            <Fields>
                                                                <ext:Label runat="server" ID="lblSocialStatus" Text="<%$Resources:lblSocialStatusText %>" />
                                                                <ext:ComboBox ID="cmbSocialStatus" runat="server" StoreID="storeSocialStatuses" DisplayField="SocialStatusName"
                                                                    ValueField="SocialStatusID" EmptyText="Social Status" Width="200px" Editable="False"
                                                                    AllowBlank="False" meta:resourcekey="cmbSocialStatusResource1" TriggerAction="All">
                                                                </ext:ComboBox>
                                                                <ext:Label runat="server" ID="lblEducationalLevel" Text="<%$Resources:lblEducationalLevelText %>" />
                                                                <ext:ComboBox ID="cmbEducationalLevel" runat="server" StoreID="storeEducationalLevels"
                                                                    Editable="False" DisplayField="EducationalLevelName" ValueField="EducationalLevelID"
                                                                    EmptyText="Educational Level" Width="200px" AllowBlank="False" meta:resourcekey="cmbEducationalLevelResource1"
                                                                    TriggerAction="All">
                                                                </ext:ComboBox>
                                                            </Fields>
                                                        </ext:MultiField>
                                                    </ext:Anchor>
                                                    <ext:Anchor>
                                                        <ext:MultiField ID="MultiField7" runat="server" HideLabel="True" meta:resourcekey="MultiFieldResource3">
                                                            <Fields>
                                                                <ext:Label runat="server" ID="lblCurrentJob" Text="<% $Resources:lblCurrentJobText %>" />
                                                                <ext:TextField runat="server" ID="txtCurrentJob" MaxLength="50" AllowBlank="False"
                                                                    NoteAlign="Top" EmptyText="Current Job" Regex="^[0-9A-zء-ي' '\n]+$" Width="600px"
                                                                    meta:resourcekey="txtCurrentJobResource1" Text="" />
                                                            </Fields>
                                                        </ext:MultiField>
                                                    </ext:Anchor>
                                                    <ext:Anchor>
                                                        <ext:Label runat="server" ID="lblRelationToCommitteeMember" Text="<% $Resources:lblRelationToCommitteeMemberText %>" />
                                                    </ext:Anchor>
                                                    <ext:Anchor>
                                                        <ext:TextArea runat="server" ID="txtRelationToCommitteeMember" NoteAlign="Top" MaxLength="500"
                                                            EmptyText=" Relation to committee member" Width="600px" meta:resourcekey="txtRelationToCommitteeMemberResource1"
                                                            Text="" Regex="^[0-9A-zء-ي' '\n]+$" />
                                                    </ext:Anchor>
                                                </ext:FormLayout>
                                            </Body>
                                        </ext:Panel>
                                    </ext:Anchor>
                                </ext:FormLayout>
                            </Body>
                        </ext:Panel>
                    </ext:Anchor>
                    <ext:Anchor>
                        <ext:Panel ID="panelLoan" runat="server" Title="Loan Data" Icon="Money" Border="false"
                            meta:resourcekey="panelLoanResource1">
                            <Body>
                                <ext:FormLayout ID="FormLayout2" runat="server" HideLabels="true" ElementStyle=""
                                    ItemCls="" meta:resourcekey="FormLayout2Resource1">
                                    <ext:Anchor>
                                        <ext:MultiField runat="server" HideLabel="True" meta:resourcekey="MultiFieldResource6">
                                            <Fields>
                                                <ext:Label runat="server" ID="lblLoanName" Text="<% $Resources:lblLoanNameText %>" />
                                                <ext:TextField runat="server" ID="txtLoanName" MaxLength="50" AllowBlank="False"
                                                    EmptyText="Loan Name" meta:resourcekey="txtLoanNameResource1" Text="" Regex="^[0-9A-zء-ي' ']+$" />
                                                <ext:Label runat="server" ID="lblLegalForm" Text="<% $Resources:lblLegalFormText %>" />
                                                <ext:ComboBox runat="server" ID="cmbLegalForm" AllowBlank="False" EmptyText="Legal Form"
                                                    DisplayField="LegalFormName" ValueField="LegalFormID" StoreID="storeLegalForms"
                                                    Editable="False" meta:resourcekey="cmbLegalFormResource1" TriggerAction="All" />
                                            </Fields>
                                        </ext:MultiField>
                                    </ext:Anchor>
                                    <ext:Anchor>
                                        <ext:MultiField runat="server" HideLabel="True" meta:resourcekey="MultiFieldResource7">
                                            <Fields>
                                                <ext:Label runat="server" ID="lblProject" Text="<% $Resources:lblProjectText %>" />
                                                <ext:ComboBox ID="cmbProject" runat="server" StoreID="storeProjects" DisplayField="ProjectName"
                                                    ValueField="ProjectID" AllowBlank="False" EmptyText="Project" Editable="False"
                                                    meta:resourcekey="cmbProjectResource1" TriggerAction="All">
                                                    <AjaxEvents>
                                                        <Select OnEvent="CmbProjects_Selected" />
                                                    </AjaxEvents>
                                                </ext:ComboBox>
                                                <ext:Label runat="server" ID="lblProjectStage" Text="<%$Resources:lblProjectStageText %>" />
                                                <ext:ComboBox ID="cmbProjectStage" runat="server" StoreID="storeProjectStages" DisplayField="Stage"
                                                    ValueField="ProjectStageID" AllowBlank="False" EmptyText="Project Stage" Editable="False"
                                                    meta:resourcekey="cmbProjectStageResource1" TriggerAction="All">
                                                    <AjaxEvents>
                                                        <Select OnEvent="CmbProjectStage_Selected" />
                                                    </AjaxEvents>
                                                </ext:ComboBox>
                                            </Fields>
                                        </ext:MultiField>
                                    </ext:Anchor>
                                    <ext:Anchor>
                                        <ext:Label runat="server" ID="lblLoanType" Text="<%$Resources:lblLoanTypeText %>" />
                                    </ext:Anchor>
                                    <ext:Anchor>
                                        <ext:Panel runat="server" Border="False" meta:resourcekey="PanelResource1">
                                            <Body>
                                                <asp:RadioButtonList CssClass="asp-radiobtnlist" runat="server" ID="rdlLoanType"
                                                    DataTextField="LoanTypeName" RepeatDirection="Horizontal" DataValueField="LoanTypeID"
                                                    meta:resourcekey="rdlLoanTypeResource1" Font-Size="12" Font-Names="tahoma,arial,helvetica,sans-serif">
                                                </asp:RadioButtonList>
                                            </Body>
                                        </ext:Panel>
                                    </ext:Anchor>
                                    <ext:Anchor>
                                        <ext:Label runat="server" ID="lblLoanStatus" Text="<%$Resources:lblLoanStatusText %>" />
                                    </ext:Anchor>
                                    <ext:Anchor>
                                        <ext:MultiField runat="server" HideLabel="True" meta:resourcekey="MultiFieldResource8">
                                            <Fields>
                                                <ext:Radio ID="radioStill" runat="server" BoxLabel=" Still " GroupName="loanStatus"
                                                    Checked="True" meta:resourcekey="radioStillResource1">
                                                </ext:Radio>
                                                <ext:Radio ID="radioNew" runat="server" BoxLabel=" New " GroupName="loanStatus" meta:resourcekey="radioNewResource1">
                                                </ext:Radio>
                                            </Fields>
                                        </ext:MultiField>
                                    </ext:Anchor>
                                    <ext:Anchor>
                                        <ext:Label runat="server" ID="lblLoanProjectAddress" Text="<%$Resources:lblLoanProjectAddressText %>" />
                                    </ext:Anchor>
                                    <ext:Anchor>
                                        <ext:TextArea runat="server" ID="txtLoanProjectAddress" AllowBlank="False" NoteAlign="Top"
                                            MaxLength="8000" HideLabel="True" Width="400px" meta:resourcekey="txtLoanProjectAddressResource1"
                                            Regex="^[0-9A-zء-ي' '\n]+$" />
                                    </ext:Anchor>
                                    <ext:Anchor>
                                        <ext:MultiField runat="server">
                                            <Fields>
                                                <ext:Label runat="server" ID="lblLoanPaymentMethods" Text="<%$Resources:lblLoanPaymentMethodText %>" />
                                                <ext:ComboBox ID="cmbLoanPaymentMethods" runat="server" StoreID="storeLoanPaymentMethods"
                                                    DisplayField="LoanPaymentMethodName" ValueField="LoanPaymentMethodID" EmptyText="Payment Method"
                                                    Editable="False" AllowBlank="False" meta:resourcekey="cmbLoanPaymentMethodsResource1"
                                                    TriggerAction="All">
                                                </ext:ComboBox>
                                            </Fields>
                                        </ext:MultiField>
                                    </ext:Anchor>
                                    <ext:Anchor>
                                        <ext:MultiField runat="server" HideLabel="True" meta:resourcekey="MultiFieldResource9">
                                            <Fields>
                                                <ext:Label runat="server" ID="lblLoanAmount" Text="<% $Resources:lblLoanAmountText %>" />
                                                <ext:NumberField runat="server" ID="txtLoanAmount" MaxLength="50" AllowBlank="False"
                                                    NoteAlign="Top" EmptyText="Loan Amount" AllowNegative="false" meta:resourcekey="txtLoanAmountResource1" />
                                                <ext:Label runat="server" ID="lblLoanPaymentPeriod" Text="<%$Resources:lblLoanPaymentPeriodText %>" />
                                                <ext:NumberField runat="server" ID="txtloanPaymentPeriod" MaxLength="10" MaxValue="2000"
                                                    AllowBlank="False" NoteAlign="Top" EmptyText="Loan payment period" MinValue="1"
                                                    Regex="^[0-9]+$" RegexText="The entery isn't valid" meta:resourcekey="txtloanPaymentPeriodResource1" />
                                                <ext:Label runat="server" ID="lblLoanPlace" Text="<%$Resources:lblLoanPlaceText %>" />
                                                <ext:ComboBox ID="cmbLoanPlaces" runat="server" StoreID="storeLoanPlaces" DisplayField="LoanPlaceName"
                                                    ValueField="LoanPlaceID" EmptyText="Loan Place" Editable="False" AllowBlank="False"
                                                    meta:resourcekey="cmbLoanPlacesResource1" TriggerAction="All">
                                                </ext:ComboBox>
                                            </Fields>
                                        </ext:MultiField>
                                    </ext:Anchor>
                                    <ext:Anchor>
                                        <ext:Label runat="server" ID="lblFamilyCurrentDebts" Text="<%$Resources:lblFamilyCurrentDebtsText %>" />
                                    </ext:Anchor>
                                    <ext:Anchor>
                                        <ext:MultiField runat="server" HideLabel="True" meta:resourcekey="MultiFieldResource10">
                                            <Fields>
                                                <ext:TextArea runat="server" ID="txtFamilyCurrentDebts" NoteAlign="Top" HideLabel="True"
                                                    Regex="^[0-9A-zء-ي' '\n]+$" Width="400px" EmptyText="Family Current Debts" meta:resourcekey="txtFamilyCurrentDebtsResource1"
                                                    Text="" />
                                            </Fields>
                                        </ext:MultiField>
                                    </ext:Anchor>
                                </ext:FormLayout>
                            </Body>
                        </ext:Panel>
                    </ext:Anchor>
                    <ext:Anchor>
                        <ext:Panel ID="pnlReceipt" runat="server" Border="false">
                            <Body>
                                <ext:FormLayout HideLabels="true" runat="server">
                                    <ext:Anchor>
                                        <ext:MultiField runat="server">
                                            <Fields>
                                                <ext:Label ID="lblRecipteNumber" runat="server" Text="<%$Resources:lblRecipteNumberText %>" />
                                                <ext:TextField runat="server" ID="txtReciptNumber" MaxLength="18" AllowBlank="False"
                                                    NoteAlign="Top" Width="200px" meta:resourcekey="txtReciptNumberResource1" Regex="^[0-9]+$"
                                                    RegexText="The entery isn't valid" />
                                                <ext:Button runat="server" Text="<%$Resources:BtnPrint %>">
                                                    <AjaxEvents>
                                                        <Click OnEvent="btnViewRecipte_Clicked" />
                                                    </AjaxEvents>
                                                </ext:Button>
                                            </Fields>
                                        </ext:MultiField>
                                    </ext:Anchor>
                                </ext:FormLayout>
                            </Body>
                        </ext:Panel>
                    </ext:Anchor>
                </ext:FormLayout>
            </Body>
            <BottomBar>
                <ext:StatusBar runat="server" ID="statusBar">
                    <Plugins>
                        <ext:ValidationStatus runat="server" FormPanelID="panelWhole" ValidIcon="Accept"
                            ErrorIcon="Exclamation" meta:resourcekey="pnlValidationResource1" />
                    </Plugins>
                    <Items>
                        <ext:Button runat="server" ID="btnBack" Icon="ArrowUndo" meta:resourcekey="btnBackResource">
                            <AjaxEvents>
                                <Click OnEvent="BtnBack_Clicked" ViewStateMode="Include" />
                            </AjaxEvents>
                        </ext:Button>
                    </Items>
                </ext:StatusBar>
            </BottomBar>
            <TopBar>
                <ext:Toolbar runat="server">
                    <Items>
                        <ext:Button runat="server" ID="btnSave" Text="Save" Icon="Disk" meta:resourcekey="btnSaveResource1">
                            <AjaxEvents>
                                <Click OnEvent="btnSave_Click" Before="return Ext.getCmp('panelWhole').getForm().isValid();">
                                    <Confirmation ConfirmRequest="true" BeforeConfirm="return Ext.getCmp('panelWhole').getForm().isValid();"
                                        Message="<%$ Resources:MBSureSave %>" Title="<%$ Resources:MBConfirm%>" />
                                    <EventMask ShowMask="true" />
                                </Click>
                            </AjaxEvents>
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
            </TopBar>
        </ext:FormPanel>
    </ext:FitLayout>
    <ext:Window runat="server" ID="wndGenerateRecipteNumber" Modal="true" ShowOnLoad="false"
        Width="550px" Height="480px">
        <AutoLoad Mode="IFrame" ShowMask="True" ManuallyTriggered="True" PassParentSize="True" />
    </ext:Window>
</asp:Content>
